AEDuplicateDesc
AEDuplicateDesc Make copy of a descriptor record
#include <AppleEvents.h> Apple Event Manager
OSErr AEDuplicateDesc ( theAEDesc, result );
DescType * theAEDesc ; descriptor record to be copied
AEDesc * result ; points to descriptor record copy
returns Error Code; 0 = no error
The AEDuplicateDesc function makes a copy of a descriptor record.
The parameter theAEDesc is the descriptor record to be copied.
The AEDuplicateDesc function returns in the result parameter the
resulting descriptor record. This function creates a new descriptor record by
copying the descriptor record from the parameter. Your application is
responsible for using the AEDisposeDesc function to dispose of the resulting
descriptor record once you are finished using it. You normally do this after
receiving a result from the AESend function.
If the function returns a nonzero result code, a descriptor record with the
typeNull descriptor type is returned. A descriptor record of this type does not
contain any data.
It's common for applications to send Apple events that have one or more
attributes or parameters in common. For example, if you're sending a series of
Apple events to the same application, the address attribute is the same. In these
cases, the most efficient way to create the necessary
Apple events is to make a template Apple event that you can then copy-by
calling the AEDuplicateDesc function-as needed. You then fill in or change
the remaining parameters and attributes of the copy, send the copy by calling
AESend, and then dispose of the copy-by calling AEDisposeDesc-after
AESend returns a result.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone